<?php
require_once("../../inc/global.php");
require_once("../menusys/function.php");
adminislogin();
if(strtolower($_SERVER['REQUEST_METHOD'])=="post"){
	$getcount=$db->getcount("select * from setsys where setsys0=1 limit 1");
	if($getcount===0){   //如果数据库没有就添加一个
		$addSqlName="insert into setsys (";		
		$addSqlValue="values(";
		for($i=0;$i<=15;$i++){
			$addSqlName.="setsys{$i}";
			if($i==0){
				$addSqlValue.="1";
			}else{
				$addSqlValue.="'".$_POST["sysset{$i}"]."'";
			}
			if($i<15){
				$addSqlName.=",";
				$addSqlValue.=",";
			}else{
				$addSqlName.=")";
				$addSqlValue.=")";
			}
		}
		$addSql=$addSqlName.$addSqlValue;
		$db->exec($addSql);
	}else{
		$updateSql="update setsys set ";
		for($i=1;$i<=15;$i++){
			$updateSql.=" setsys{$i}='".$_POST["sysset{$i}"]."' ";
			if($i<15){
			$updateSql.=",";
			}else{
				$updateSql.=" where setsys0=1";
			}
		}
		$db->exec($updateSql);
	}
}
$Info_Data=@$db->getoners("select * from setsys where setsys0=1");
echo "<html >
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
<title>系统设置</title>
<link href=\"../../Css.css\" rel=\"stylesheet\" type=\"text/css\">
</head>
<body style=\"padding:0px; margin:0px;\">
<table width=\"100%\" height=\"275\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#0099cc\">
  <tr class=\"YKTth\">
    <td height=\"26\" style=\"background-color:#42c4e6\"><span class=\"Font12W\"style=\"color:#ffffff\">当前位置：系统管理 > 系统设置 </span><br></td>
  </tr>
  <tr class=\"YKTtd\">
    <td>
<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\">
  
<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\" style=\"border-top:#0099cc solid 1px;\">
    <tr>
      <td colspan=\"3\" height=\"10\"></td>
    </tr>
    <tr>
      <td width=\"32%\"  class=\"TdLineBG\"><div align=\"right\">公司名称[1]：</div></td>
      <td width=\"50%\"  class=\"TdLine\"><label>
        <input name=\"sysset1\" type=\"text\" value=\"{$Info_Data[1]}\" size=\"50\"  class=\"InputNone\"/>
      </label></td>
      <td width=\"18%\"  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">公司地址[2]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset2\" type=\"text\" value=\"{$Info_Data[2]}\" size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">联系人[3]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset3\" type=\"text\" value=\"{$Info_Data[3]}\"  size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"> <div align=\"right\">咨询电话[4]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset4\" type=\"text\" value=\"{$Info_Data[4]}\"  size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">客服热线[5]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset5\" type=\"text\" value=\"{$Info_Data[5]}\"  size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">传真[6]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset6\" type=\"text\" value=\"{$Info_Data[6]}\"  size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">网址[7]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset7\" type=\"text\" value=\"{$Info_Data[7]}\"  size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">Email[8]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset8\" type=\"text\" value=\"{$Info_Data[8]}\"  size=\"50\"   class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">邮编[9]：</div></td>
      <td  class=\"TdLine\"><label>
      <input name=\"sysset9\" type=\"text\" value=\"{$Info_Data[9]}\"    class=\"InputNone\"/>
      </label></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">ICP号[10]：</div></td>
      <td  class=\"TdLine\"><input name=\"sysset10\" type=\"text\" value=\"{$Info_Data[10]}\"  size=\"50\"   class=\"InputNone\"/></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
	<tr>
      <td  class=\"TdLineBG\"><div align=\"right\">KeyWords[11]：</div></td>
      <td  class=\"TdLine\"><input name=\"sysset11\" type=\"text\" value=\"{$Info_Data[11]}\"  size=\"50\"   class=\"InputNone\" maxlength=\"255\"/></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
	    <tr>
      <td  class=\"TdLineBG\"><div align=\"right\">Description[12]：</div></td>
      <td  class=\"TdLine\"><textarea name=\"sysset12\" cols=\"50\" rows=\"3\" class=\"InputTextArea\" id=\"sysset12\">{$Info_Data[12]}</textarea></td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
	    <tr style=\"display:\">
      <td  class=\"TdLineBG\"><div align=\"right\">服务QQ号[13]：</div></td>
      <td  class=\"TdLine\"><input name=\"sysset13\" type=\"text\"   class=\"InputNone\" value=\"{$Info_Data[13]}\"  size=\"50\" maxlength=\"255\"/>
        <br />
        *多个QQ号请用“|”分开,禁用此功能请输入“0”</td>
      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
	    <tr style=\"display:\">
          <td  class=\"TdLineBG\"><div align=\"right\">计数器[14]：</div></td>
	      <td  class=\"TdLine\"><input name=\"sysset14\" type=\"text\"   class=\"InputNone\" id=\"sysset14\" value=\"{$Info_Data[14]}\"  size=\"50\" maxlength=\"255\"/>
              <br /></td>
	      <td  class=\"TdLine\">&nbsp;</td>
    </tr>
        <tr>
          <td  class=\"TdLineBG\"><div align=\"right\">代码嵌入[15]：</div></td>
          <td  class=\"TdLine\"><textarea name=\"sysset15\" cols=\"50\" rows=\"3\" class=\"InputTextArea\" id=\"sysset15\">{$Info_Data[15]}</textarea>
              <br /></td>
          <td>&nbsp;</td>
        </tr>
    <tr>
      <td height=\"30\">&nbsp;</td>
      <td valign=\"bottom\"><input type=\"image\" name=\"sumbit\" src=\"../../iamges/botton_baocun.png\" /></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
</td>
  </tr>
</table>
</body>
</html>";
?>
